import request from '@/api/index'

// 样本详细信息
export function sampleDetail(id) {
    return request({
        url: `/cloud/sample/`+id,
        method: 'get',
    })
}

// 删除样本库分类
export function deleteSample(ids) {
  return request({
      url: `/cloud/sample/${ids}`,
      method: 'post',
  })
}

// 导出
export function exportSample(data) {
  return request({
      url: `/cloud/sample/export`,
      method: 'post',
      responseType: 'blob',
      params:data
  })
}
// 下载导入模板
export function exportTemplate(data) {
  return request({
      url: `/cloud/sample/import/template`,
      method: 'post',
      responseType: 'blob',
      params:data
  })
}
// 导入
export function importSample(data,params) {
  console.log(data,'data---')
  return request({
      url: `/cloud/sample/import`,
      timeout:600000,
      method: 'post',
      responseType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      data,
      params
  })
}
// 查询样本库列表
export function getSampleList(query) {
    return request({
        url: '/cloud/sample/page',
        method: 'get',
        params: query
    })
}

// 新增
export function saveSample(data) {
  return request({
    url: '/cloud/sample/save',
    method: 'post',
    data:data
  })
}
// 修改
export function updateSample(data) {
  return request({
    url: '/cloud/sample/update',
    method: 'post',
    data:data
  })
}


// 样本库详细信息
export function libraryDetail(id) {
  return request({
      url: `/cloud/library/`+id,
      method: 'get',
  })
}

// 删除样本库分类
export function deleteLibrary(ids) {
return request({
    url: `/cloud/library/${ids}`,
    method: 'post',
})
}
// 查询样本库分类列表
export function typeList(query) {
  return request({
      url: '/cloud/type/list',
      method: 'get',
      params: query
  })
}
// 查询样本库列表
export function getLibraryList(query) {
  return request({
      url: '/cloud/library/page',
      method: 'get',
      params: query
  })
}

// 新增
export function saveLibrary(data) {
return request({
  url: '/cloud/library/save',
  method: 'post',
  data:data
})
}
// 修改
export function updateLibrary(data) {
return request({
  url: '/cloud/library/update',
  method: 'post',
  data:data
})
}


// 样本库分类详细信息
export function typeDetail(id) {
  return request({
      url: `/cloud/type/`+id,
      method: 'get',
  })
}

// 删除样本库分类
export function deleteType(ids) {
return request({
    url: `/cloud/type/${ids}`,
    method: 'post',
})
}

// 查询样本库列表
export function getTypeList(query) {
  return request({
      url: '/cloud/type/page',
      method: 'get',
      params: query
  })
}

// 新增样本库分类
export function saveType(data) {
return request({
  url: '/cloud/type/save',
  method: 'post',
  data:data
})
}
// 修改样本库分类
export function updatetype(data) {
return request({
  url: '/cloud/type/update',
  method: 'post',
  data:data
})
}
